/*************************************************
* TABLE A7: Staff Compensation (House) Full Result 
**************************************************/
clear
use masterdata_house1.dta
sort core_person_id
merge core_person_id using firstcong.dta
keep if _merge == 3
drop _merge
la var firstcong "congress staffer appeared first time in the data"
keep if firstcong >=108
gen exp = 2*(congress - firstcong +1) 
gen femalestaff = 0
replace femalestaff = 1 if gender =="F"
gen memfemale = 0
replace memfemale = 1 if minwomen + majwomen > 0

macro define member_char1 "dem memfemale majority chair subchr seniority maj_leader min_leader power"
macro define member_char2 "majority chair subchr seniority maj_leader min_leader power"
macro define staff_char1  "exp totworkdays rank nondc notfulltime"
macro define staff_char2  "exp totworkdays rank nondc notfulltime jdphd grad_degree "

gen int1 = dem*femalestaff
gen int2 = dem*femalestaff*memfemale

eststo clear
eststo: quietly reg  salary femalestaff           $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1      $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1 int2 $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char1 i.congress, a(member_office_id) vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char2 i.congress, a(member_office_id) vce(cluster member_office_id)
esttab, star(* 0.05 ** 0.01 *** 0.001) drop(*congress*) se ar2
